from faker import Factory


fake = Factory().create("zh_CN")

# 构造常用的python数据类型
# 字符串
random_python_str = fake.pystr()
# 整型
random_python_int = fake.pyint()
# 浮点型
random_python_float = fake.pyfloat()
# 布尔型
random_python_bool = fake.pybool()
# 元组
random_python_tuple = fake.pytuple(nb_elements=5)
# 列表
random_python_list = fake.pylist(nb_elements=5)
# 字典
random_python_dictionary = fake.pydict(nb_elements=5)

# UUID
random_uuid = fake.uuid4()

# 长文本
random_text = fake.text()

# 图片链接
random_image_url = fake.image_url()

# 文件路径
random_file_path = fake.file_path()


# 安全类信息
# 操作系统信息
def random_os_info(os_type: str = "win"):
    if os_type == "win":
        return fake.windows_platform_token() + " " + fake.linux_processor()
    elif os_type == "linux":
        return fake.linux_processor()
    elif os_type == "mac":
        return fake.mac_platform_token()
    elif os_type == "ios":
        return fake.ios_platform_token()
    elif os_type == "android":
        return fake.android_platform_token()
    else:
        return None


# hash加密
random_hash_md5 = fake.md5()
random_hash_sha1 = fake.sha1()
random_hash_sha256 = fake.sha256()

# 构造密码
random_password = fake.password(
    length=10, special_chars=False, digits=True, upper_case=True, lower_case=True
)

# 个人信息类
# 姓名
random_name = fake.name()
# 地址
random_address = fake.address()
# 电话
random_phone = fake.phone_number()
# 工作
random_job = fake.job()
# 身份证号(18-50周岁范围内)
random_ssn = fake.ssn(min_age=18, max_age=50)
# 银行卡号
random_credit_card_no = fake.credit_card_number()
# 公司信息
random_company = fake.company()
# 邮箱
random_email = fake.email()
# 生日(18-50周岁)
random_birth = fake.date_of_birth(minimum_age=18, maximum_age=50)
# 完整个人信息
random_profile = fake.profile()


if __name__ == "__main__":
    print(random_profile)
